//
//  MBOrderNaviView.m
//  MemberBusiness-ios
//
//  Created by cherry pu on 2018/4/24.
//  Copyright © 2018年 zhangXin. All rights reserved.
//

#import "MBOrderNaviView.h"

@implementation MBOrderNaviView

- (instancetype)init
{
    self = [super init];
    if (self) {
        
        UITextField* searchTextField = [[UITextField alloc]init];
        self.searchTextField = searchTextField;
        searchTextField.returnKeyType = UIReturnKeySearch;
        searchTextField.layer.cornerRadius = [UIView lf_sizeFromIphone6:15];
        searchTextField.backgroundColor = [UIColor colorWithR:240 G:242 B:245];
        searchTextField.font = [UIFont lf_systemFontOfSize:13];
        searchTextField.layer.masksToBounds = YES;
        searchTextField.placeholder = @"订单编号查询";
        UIView* searchLeftView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, [UIView lf_sizeFromIphone6:27], [UIView lf_sizeFromIphone6:30])];
        UIImageView* searchImageView = [[UIImageView alloc]initWithImage:[[UIImage imageNamed:@"home_nav_2_search"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]];
        searchImageView.tintColor = [UIColor colorWithR:136 G:136 B:136];
        searchImageView.frame = CGRectMake([UIView lf_sizeFromIphone6:5], [UIView lf_sizeFromIphone6:6], [UIView lf_sizeFromIphone6:17], [UIView lf_sizeFromIphone6:17]);
        [searchLeftView addSubview:searchImageView];
        searchTextField.leftView = searchLeftView;
        searchTextField.leftViewMode = UITextFieldViewModeAlways;
        [self addSubview:searchTextField];
        
        [searchTextField mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self).offset(SCREEN_STATUS_BAR_HEIGHT+[UIView lf_sizeFromIphone6:8]);
            make.left.equalTo(self).offset([UIView lf_sizeFromIphone6:17]);
            make.size.mas_equalTo(CGSizeMake([UIView lf_sizeFromIphone6:286], [UIView lf_sizeFromIphone6:30]));
        }];

        UIButton* groupButton = [[UIButton alloc]init];
        self.groupButton = groupButton;
        [groupButton setTitle:@"拼团订单" forState:UIControlStateNormal];
        groupButton.titleLabel.font = [UIFont lf_systemFontOfSize:13];
        [self addSubview:groupButton];
        
        [groupButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(searchTextField);
            make.right.equalTo(self).offset([UIView lf_sizeFromIphone6:-11]);
        }];

    }
    return self;
}

@end
